<template>
    <!-- 首页顶部指数卡片 -->
  <a-card :title="name" :bordered="cardborder" size="small" >
    <a-row type="flex" justify="space-around" align="bottom">
      <a-col :span="12" >
        <a-statistic
          :value="num"
          :precision="precision"
          :value-style="{ 'color': 'red','font-size':'30px' }"
        >
        </a-statistic>
      </a-col>
      <a-col :span="12">
        <a-statistic
          :value="zdf"
          :precision="precision"
          suffix="%"
          :value-style="{ 'color': '#3f8600','font-size':'5px','padding-left':'15px' }"
        >
          <template #prefix>
            <a-icon :type="jt" />
          </template>
        </a-statistic>
      </a-col>
    </a-row>
    <a-row style="margin-top: 3px">
      <a-col>
        更新日期：{{curDate}}
      </a-col>
    </a-row>

  </a-card>
</template>

<script>
    export default {
      name: "HomeCard",
      props: {
        curDate: String,
        num: Number,
        zdf: Number,
        name: String
      },
      computed: {
        jt :function (){
          if (this.zdf > 0){
            return "caret-up";
          }else{
            return "caret-down";
          }
        }

      },
      data(){
        return {
          cardborder: true,
          precision: 2,
          // dzdf: this.zdf,
        }
      }

    }
</script>

<style scoped>

</style>
